﻿@using INNOVACALL.Framework.Common
@using InnovaApp.Layers.ResourcesLayer.Properties
@using InnovaApp.Portals.MVC4Portal.Controllers
@{
    Layout = "_LayoutSiteCommon.cshtml";
    string StyleBundleBase = string.Empty;
    InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base layoutModel =
        (InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base)Model;

    string MyPrettyCMSContentWidth = string.Format("{0}px", InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]);
    string adminModeCSSClass = (layoutModel._AdminMode ? "adminMode" : "");

    string cssPreMenuToAdd = string.Empty;
    string cssMenuToAdd = string.Empty;
    string cssPostMenuToAdd = string.Empty;
    string cssPreMenuDisplay = string.Empty;
    string cssPostMenuDisplay = string.Empty;
    string cssDivContent = string.Empty;

    cssPreMenuToAdd = (bool.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPreMenu]) ? string.Format(".premenu{{height:{0}px;width:{1}px;}}", PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_PreMenuHeight], InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]) : "");
    cssMenuToAdd = string.Format(".menu{{width:{0}px;}}", InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]);
    cssPostMenuToAdd = (bool.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPostMenu]) ? string.Format(".postmenu{{height:{0}px;width:{1}px;}}", InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_PostMenuHeight], InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]) : "");
    cssPreMenuDisplay = (!bool.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPreMenu]) ? "notDisplayed" : "");
    cssPostMenuDisplay = (!bool.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPostMenu]) ? "notDisplayed" : "");

    int sp_ContentBodyPaddingTop = int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingTop]);
    int sp_ContentBodyPaddingLeft = int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingLeft]);
    int sp_ContentBodyPaddingRight = int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingRight]);
    int sp_ContentBodyPaddingBottom = int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingBottom]);

    cssDivContent = string.Format(
@"
        #divBody{{
            min-height:{4}px;
            width:{5}px;
        }}
        #MyPrettyCMSContent{{
            width:{5}px;
        }}
        #divBody{{
            padding-top : {0}px;
            padding-left : {1}px;
            padding-right : {2}px;
            padding-bottom : {3}px;
            width:{6}px;
        }}
",
sp_ContentBodyPaddingTop,
sp_ContentBodyPaddingLeft,
sp_ContentBodyPaddingRight,
sp_ContentBodyPaddingBottom,
InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentHeight],
InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth],
int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]) - (sp_ContentBodyPaddingLeft + sp_ContentBodyPaddingRight)
);
}
@section HeadLocalCSS {
    <style type="text/css" id="StyleContentWrapper">
        @cssPreMenuToAdd
        @cssMenuToAdd
        @cssPostMenuToAdd
        @cssDivContent
    </style>

    <script type="text/javascript">
        $.fn.SiteLayoutPrepareMenu = function () {
            $("#layoutMenu").kendoMenu({
                open: $.fn.KendoMenuOpenFixup
            });
            $("#layoutMenu").removeClass("notDisplayed");
        }
    </script>
}
<div class="myprettycms wholePage @adminModeCSSClass BGUpload">
    <div class="myprettycms premenu content-wrapper @adminModeCSSClass @cssPreMenuDisplay BGUpload">
        <div class="float-left" >
            <section id="LanguageSelector">
                @Html.Partial("_LanguageSelector", layoutModel._Languages)
            </section>
        </div>
        <div class="float-right">
            <section id="login">
                @Html.Partial("_LoginPartial", layoutModel._Languages.SelectedLanguage)
            </section>
        </div>
        <div class="myprettycms premenucontent content-wrapper">
        </div>
    </div>
    <div class="myprettycms menu content-wrapper">
        @if (layoutModel._DisplayMenus)
        { 
            <nav>
                <div id="divMenuBar">
                    @Html.Partial("_MenuBar", layoutModel._Menus)
                </div>
                <div class="layoutMenuCache">
                </div>
            </nav>
        }
    </div>
    <div class="myprettycms postmenu content-wrapper @cssPostMenuDisplay">
    </div>
    @if (IsSectionDefined("StructurePageEditor"))
    {
        <div class="divStructurePageEditor notDisplayed">
            @RenderSection("StructurePageEditor")
        </div> 
    }
    <div id="MyPrettyCMSContent" class="content-wrapper full-height page shadow">
        <div id="divBody">
            @RenderBody()
        </div>
    </div>

    <div class="notDisplayed" id="SingleFileUploadDialogDiv">
        @using (Html.BeginForm("", "SingleFileUpload", FormMethod.Post, new { id = "SingleFileUploadForm", enctype = "multipart/form-data", target = "SingleFileUploadIFrame" }))
        { 
            <input type="file" id="SingleFileUploadFileInput" name="SingleFileUploadFileInput" class="ui-autocomplete-input ui-widget-content ui-corner-all" />    
            <input type="hidden" name="SingleFileUploadImageToUpdateIdHidden" id="SingleFileUploadImageToUpdateIdHidden" />
            <input type="submit" id="SingleFileUploadSubmitButton" />
        }
        <iframe class="notDisplayed" name="SingleFileUploadIFrame"></iframe>
    </div>
</div>
@section SiteFooter{
    <footer>
        <div class="FooterCopyright">
            <a href="http://www.innovacall.com">&copy; INNOVACALL 2012</a>
        </div>
        <div class="FooterLogoMyPrettyCMS">
            <a href="http://www.innovacall.com" target="_blank">
                <img src="/Images/LogoInnovacallMyPrettyCMS.png" alt="Done with Innovacall My Pretty CMS" />
            </a>
        </div>
    </footer>
}